<template>
  <div class="swiper-wrap">
    <swiper ref="mySwiper" :options="swiperOption" v-if="swiperlist.length">
      <swiper-slide v-for="item in swiperlist" :key="item.id">
        <img class="swiper-img" :src="item.imgUrl" alt="图片缺失" />
      </swiper-slide>
      <div class="swiper-pagination" slot="pagination"></div>
    </swiper>
  </div>
</template>

<script>
export default {
  name: 'HomeSwiper',
  props: {
    swiperlist: Array
  },
  data() {
    return {
      swiperOption: {
        pagination: '.swiper-pagination',
        loop: true
      }
    }
  },
  methods: {
    a: function() {}
  },
  computed: {
    swiper() {}
  },
  mounted() {
    // console.log('Current Swiper instance object', this.swiper)
  }
}
</script>
<style lang="less" scoped>
.swiper-wrap {
  overflow: hidden;
  padding-bottom: 31.25%;
  background-color: #eee;
  height: 0;
  position: relative;
  .swiper-pagination {
    bottom: 0;
    left: 0;
    right: 0;
    /deep/ .swiper-pagination-bullet {
      margin: 0 5px;
    }
    /deep/ .swiper-pagination-bullet-active {
      background: #fff;
    }
  }
}
.swiper-img {
  width: 100%;
  height: 31.25vw;
}
</style>
